package com.lagou.enu;

public enum SqlType {
    SELECT_LIST("1", "selectList", "查询所有或者多条"),
    SELECT_ID("2", "selectById", "根据id主键查询一条"),
    UPDATE_TABLE("3", "updateTable", "根据条件更新多条记录"),
    UPDATE_ID("4", "updateTableById", "根据主键更新一条记录"),
    DELETE_ID("5", "deleteTableById", "根据主键删除一条记录"),
    DELETE_TABLE("6", "deleteTable", "根据条件删除多条记录");
    private String id;
    private String method;
    private String desc;

    SqlType(String id, String method, String desc) {
        this.id = id;
        this.desc = desc;
        this.method = method;
    }

    public SqlType getMethodInfo(String method) {
        for (SqlType sqlType : SqlType.values()) {
            if (method.equals(sqlType.getMethod())) {
                return sqlType;
            }
        }
        return null;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

}
